package com.eee.xiang.market.controller;

import com.eee.xiang.market.beans.OperateResponse;
import com.eee.xiang.market.beans.TUser;
import com.eee.xiang.market.common.ResponseResult;
import com.eee.xiang.market.service.ILoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;

@RequestMapping("/login")
@Controller
public class LoginController {

    @Resource(name = "loginService")
    private ILoginService loginService;

    @RequestMapping("/index")
    String loginIndex() {
        return "index";
    }

    @RequestMapping(value = "/login")
    @ResponseBody
    OperateResponse login(TUser user) {
        return loginService.login(user);
    }

}
